home *** CD-ROM | disk | FTP | other *** search
/ Graphics Plus / Graphics Plus.iso / amiga / opalvisn / oprxwind.lzh / PutBrushPT&ST.oprx < prev    next >
Encoding:
Text File  |  1993-02-04  |  3.7 KB  |  117 lines

  1. /* PutBrushPT&ST.oprx: ARexx script for OpalPaint to paste a brush in both
  2.  * the stencil and paint modes in the same position.  Use for a quick mask
  3.  * for text and other brushes, without having to worry about finding the
  4.  * exact place that you stamped your brush.  Stencil is done first, so the
  5.  * paint mode can be undone.  Invert the stencil and recolor text, etc.
  6.  ***** Brian Wind, February 3, 1993 *****
  7.  * Install in your OpalPaint rexx directory (opalpaint:rexx) or wherever
  8.  * you store your ARexx scripts (rexx:).  Use OpalPaint's ARexx Control Item
  9.  * to set this script to a function key (i.e. type the script name into one
  10.  * of the function key boxes).  Then make a brush in B1, B2, or B3.  Press
  11.  * Amiga key and function key together, and follow the directions.
  12.  * After running script, you can go to ST mode, invert the stencil, return
  13.  * to paint mode and recolor, rubthru or alter the area under the stamp.
  14.  * Note: using a small rectangular brush doesn't work quite right in
  15.  * OpalPaint 1.4.
  16.  */
  17.  
  18. address 'OpalPaint_Rexx'
  19.  
  20. options Results
  21.  
  22. /*SaveSetUp*/
  23.  
  24. AskInt 1 3 "Brush Number (1-3), click OK for default: Brush 1\nClick Cancel to abort."
  25. if RC>4 then exit
  26.         else BN=result
  27.  
  28. /* if okay was pressed and no number was entered, use default brush 1 */
  29. if BN=="" then BN=1
  30.  
  31. /* Set active brush */
  32. ActiveBrush BN
  33.  
  34.  
  35. /*
  36. A1="To invert the stencil before placing the brush click Cancel.\n"
  37. A2="Use this if you need to blow a hole into a stencil.\n"
  38. A3="Otherwise click OK to continue with normal procedure."
  39. AskBool A1 || A2 || A3
  40. if RC>5 then exit
  41.         else invST=result
  42. */
  43.  
  44.  
  45. AskBool "Click on the image to paste\nor choose Cancel to abort."
  46. if RC>5 | result==0 then exit
  47.  
  48.  
  49. /* Let user click on image to place brush */
  50. GetPoint
  51. if RC>5 then exit
  52. parse var result PX PY
  53.  
  54.  
  55. /* Next statement for debug purposes */
  56. /*askbool invST' 'bn' 'PX' 'PY*/
  57.  
  58. /*Busy*/
  59.  
  60. /* set to freehand drawing tool */
  61. FreeHand
  62.  
  63. /* turn on stencil mode, invert if chosen, put brush at selected position */
  64. WorkMode STENCIL
  65.  
  66. /**************************************************************************
  67.  * If this line, and the next similar line are used along with the AskBool
  68.  * above which sets invST, the program double stamps the brush when PutBrush
  69.  * is used and invST=0 (Cancel is chosen for invert stencil askbool).  This
  70.  * is shown by either no hole being cut into mask or if the cursor is moved
  71.  * quickly after chosing the position, there are 2 holes cut into the mask
  72.  * To test use a mask (stencil) which covers the entire screen.
  73.  **************************************************************************/
  74. /*if invST=0 then InvertSten*/
  75. PutBrush PX PY
  76.  
  77. /* invert stencil back to pre script state */
  78. /*if invST=0 then InvertSten*/
  79.  
  80. /* flip to paint mode and turn off stencil to paint brush */
  81. WorkMode IMAGE
  82. StenEnable 0
  83. ColorSource MULTICOLOR
  84. PutBrush PX PY
  85.  
  86. /*NotBusy*/
  87.  
  88. /* To return your original setup (i.e. sten on, AL mode, tran etc.), remove
  89.  * the comment markers on the next line.  Be forewarned that this will not
  90.  * allow you to undo the last painting step */
  91. /*RestoreSetUp*/
  92.  
  93. /* or remove the comments around this group of commands to give a simple
  94.  * undo of stencil and paint (simple means that when the brush was stamped
  95.  * in ST mode it could have already masked some other detail in your
  96.  * stencil and this can not be undone */
  97. /*
  98. TB1="Click Cancel to undo the procedure.\n"
  99. TB2="The stencil will be stamped in reverse,\n"
  100. TB3="any detail covered up is already lost."
  101. AskBool TB1 || TB2 || TB3
  102. if RC>5 | Result==1 then exit
  103.     else
  104.       do
  105.         Undo
  106.         WorkMode STENCIL
  107.         if invST=1 then InvertSten
  108.         PutBrush PX PY
  109.         if invSt=1 then InvertSten
  110.         WorkMode IMAGE
  111.         StenEnable 0
  112.       end
  113. RestoreSetUp
  114. */
  115.  
  116. exit
  117.